Snapshot: Staff vs Faculty
source('utils/utils.R')
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
data <- read.csv('data/college_data.csv')
Y <- "Total.FTE.staff..DRVHR2018."
X <- "Instructional..research.and.public.service.FTE..DRVHR2018."
ID <- "Institution.Name"
SZ <- "Total..enrollment..DRVEF2018."
carnegie <- "Carnegie.Classification..HD2018."
landgrant <- "Land.Grant.Institution..HDNo0Yes8."
sector <- "Sector.of.institution..HDPrivate0Public8."
regression <- linregression_traditional(data,X,Y,carnegie)

summary_reg <- summary(regression)
rsquared <- summary_reg$r.squared
coeffs <- summary_reg$coefficients
- We observe an \(R^2\) value of 0.9072477, which is quite high
- For every research/instructional employee, we have 3 staff employees!
Use ggplot2 instead: nicer plots
foo <- ggplotRegression(data,Y,X,carnegie,sector,'US Doctoral Universities')
foo[[1]]

summary_reg <- summary(foo[[2]])
rsquared <- summary_reg$r.squared
coeffs <- summary_reg$coefficients
- We observe an \(R^2\) value of 0.9072477, which is quite high
- For every research/instructional employee, we have 3 staff employees!
Use plotly to get an interactive plot!
- RMarkdown supports a number of different HTML widgets that breathe life into your data!
- HTML widgets are based on Javascript
- Do not worry about it: R got your back.
plotly works well with ggplot2.
ggplotly(foo[[1]], tooltip = c('id', 'enroll', 'x', 'y'))
- Find more information on how to make interactive plots here.